


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Downloading liblept pre-built binaries and header files for Windows &mdash; Leptonica &amp; Visual Studio 2008</title>
    <link rel="stylesheet" href="_static/leptonica.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '',
        VERSION:     '1.68',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <script type="text/javascript" src="_static/sidebar.js"></script>
    <link rel="top" title="Leptonica &amp; Visual Studio 2008" href="index.html" />
    <link rel="next" title="Building programs that link with liblept" href="building-other-programs.html" />
    <link rel="prev" title="Quickstart" href="quickstart.html" />
 
    <link href='http://fonts.googleapis.com/css?family=Droid+Serif:regular,italic,bold,bolditalic' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Droid+Sans:regular,bold' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Droid+Sans+Mono' rel='stylesheet' type='text/css'>
    <script type="text/javascript" src="http://www.google-analytics.com/urchin.js"></script>
    <script type="text/javascript" src="_static/sort-filter-table-compact.js"></script>
   


  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="building-other-programs.html" title="Building programs that link with liblept"
             accesskey="N">next</a></li>
        <li class="right" >
          <a href="quickstart.html" title="Quickstart"
             accesskey="P">previous</a> |</li>
  <li><a href="http://www.leptonica.com">Leptonica Home</a> &raquo;</li>
  
        <li><a href="index.html">VS2008 Notes (for v1.68)</a> &raquo;</li>
 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="downloading-liblept-pre-built-binaries-and-header-files-for-windows">
<span id="downloading-pre-built-binaries"></span><h1>Downloading <span class="filesystem">liblept</span> pre-built binaries and header files for Windows<a class="headerlink" href="#downloading-liblept-pre-built-binaries-and-header-files-for-windows" title="Permalink to this headline">¶</a></h1>
<p>The easiest way to use <span class="filesystem">liblept</span> is to download the latest version of
<span class="filesystem">leptonica-</span><span class="filesystem">1.68</span><span class="filesystem">-win32-lib-include-dirs.zip</span>, the pre-built
binary archive, from <a class="reference external" href="http://tpgit.github.com/UnOfficialLeptDocs/leptonica/source-downloads.html#windows-pre-built-binaries">the Leptonica website</a>.</p>
<p>It contains the entire <span class="filesystem">lib</span> and <span class="filesystem">include</span> directories needed to build
Windows-based programs that use the static or dynamic versions of the
<span class="filesystem">liblept</span> library (including static library versions of <span class="filesystem">zlib</span>,
<span class="filesystem">libpng</span>, <span class="filesystem">libjpeg</span>, <span class="filesystem">libtiff</span>, and <span class="filesystem">giflib</span>). The libraries are built
with Microsoft Visual Studio 2008 32-bit. The complete contents of the
archive can be seen <a class="reference internal" href="directory-organization.html#include-contents"><em>here</em></a>.</p>
<p>Unpack this file to the same directory that <span class="filesystem">liblept</span> will be in. For
example, after unpacking you should have something similar to this:</p>
<pre class="literal-block">
BuildFolder\
  include\
  leptonica-1.68\
  lib\
</pre>
<p>The archive contains the latest releases of the supported image
libraries at the time <span class="filesystem">liblept</span> was released. For the current version
(Leptonica-1.68) these are:</p>
<table border="1" class="centered centercells docutils" id="image-library-versions">
<caption>Image Library Versions</caption>
<colgroup>
<col width="31%" />
<col width="28%" />
<col width="41%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Library</th>
<th class="head">Version</th>
<th class="head">Date</th>
</tr>
</thead>
<tbody valign="top">
<tr><td>zlib</td>
<td><a class="reference external" href="http://www.zlib.net/zlib125.zip">1.2.5</a></td>
<td>19-Apr-2010</td>
</tr>
<tr><td>libpng</td>
<td><a class="reference external" href="http://prdownloads.sourceforge.net/libpng/lpng143.zip">1.4.3</a></td>
<td>25-Jun-2010</td>
</tr>
<tr><td>libjpeg</td>
<td><a class="reference external" href="http://www.ijg.org/files/jpegsr8c.zip">8c</a></td>
<td>16-Jan-2011</td>
</tr>
<tr><td>libtiff</td>
<td><a class="reference external" href="http://download.osgeo.org/libtiff/tiff-3.9.4.zip">3.9.4</a></td>
<td>15-Jun-2010</td>
</tr>
<tr><td>giflib</td>
<td><a class="reference external" href="http://sourceforge.net/projects/giflib/files/giflib%204.x/giflib-4.1.6/giflib-4.1.6.tar.gz/download">4.1.6</a></td>
<td>10-Nov-2007</td>
</tr>
</tbody>
</table>
<p>A simple method to print out the versions of <span class="filesystem">liblept</span> and its image
libraries is shown in the <a class="reference internal" href="quickstart.html#building-hello-liblept"><em>Quickstart</em></a>.</p>
<p>If you&#8217;d like to determine the compiler options used to build these
binaries or build them yourself see <a class="reference internal" href="building-liblept.html"><em>(Optional) Building the liblept library</em></a> and
<a class="reference internal" href="building-image-libraries.html"><em>(Optional) Building zlib, libjpeg, libpng, libtiff and giflib</em></a>.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Executables for the programs in the <span class="filesystem">liblept</span> <span class="filesystem">/prog</span> directory are
<strong>not</strong> included in this archive. Follow these <a class="reference internal" href="building-prog-dir.html"><em>instructions</em></a> to build them yourself.</p>
</div>
<div class="section" id="about-version-numbers-in-library-filenames">
<span id="about-version-numbers"></span><h2>About version numbers in library filenames<a class="headerlink" href="#about-version-numbers-in-library-filenames" title="Permalink to this headline">¶</a></h2>
<p>To make it possible to tell at a glance which version of the libraries
are being provided, they all now have version numbers as part of their
filenames. This, however, this makes them somewhat more difficult to use
in Visual Studio Projects and external makefiles when the versions
change.</p>
<p id="making-hardlinks">There are two different solutions to this versioning problem. The first
is the <span class="filesystem">create_unnumbered_hardlinks.bat</span> batch file which uses the
built-in Windows command-line program <span class="command">fsutil</span> to make simplified
filenames by creating NTFS hardlinks to the versioned files.</p>
<p>Copy <span class="filesystem">C:BuildFolder\leptonica-</span><span class="filesystem">1.68</span><span class="filesystem">\vs2008\create_unnumbered_hardlinks.bat</span> and
<span class="filesystem">remove_unnumbered_hardlinks.bat</span> to <span class="filesystem">C:\BuildFolder\lib</span>. Then, after
opening a Command Window, switching to the <span class="filesystem">C:\BuildFolder\lib</span>
directory and running <span class="filesystem">create_unnumbered_hardlinks.bat</span> (or just
double-clicking it in Windows Explorer) you&#8217;ll be able to refer to the
static <span class="filesystem">liblept</span> library:</p>
<blockquote>
<div><pre class="literal-block">
liblept168-static-mtdll.lib
</pre>
</div></blockquote>
<p>as any of the following:</p>
<blockquote>
<div><pre class="literal-block">
leptonlib-static-mtdll.lib
liblept168-static.lib
liblept-static.lib
</pre>
</div></blockquote>
<p>and the import library for the <span class="filesystem">liblept</span> DLL:</p>
<blockquote>
<div><pre class="literal-block">
liblept168.lib
</pre>
</div></blockquote>
<p>as:</p>
<blockquote>
<div><pre class="literal-block">
leptonlib.lib
liblept168.lib
liblept.lib
</pre>
</div></blockquote>
<p>Similarly, you&#8217;ll be able to refer to:</p>
<div class="highlight-none"><div class="highlight"><pre>libtiff394-static-mtdll.lib
</pre></div>
</div>
<p>as:</p>
<div class="highlight-none"><div class="highlight"><pre>libtiff-static-mtdll.lib
libtiff394.lib
libtiff.lib
</pre></div>
</div>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">A NTFS hardlink doesn&#8217;t act quite the same as a unix symbolic
link. If the target of the link is deleted or renamed, the hardlink
becomes a <em class="bold-italic">copy</em> of the original file. When in doubt after
updating/rebuilding the targets, it&#8217;s best to remake the hardlinks by
first running <span class="filesystem">remove_unnumbered_hardlinks.bat</span> and then running
<span class="filesystem">create_unnumbered_hardlinks.bat</span> again.</p>
</div>
<p id="using-versionnumbers-property-sheet">For those who don&#8217;t want to rely on NTFS hardlinks, another solution is
provided for handling numbered library filenames within Visual Studio
Projects. To use it, set your Project&#8217;s <em class="guilabel">Configuration
Properties | C/C++ | General | Inherited Property Sheets</em> to:</p>
<blockquote>
<div><pre class="literal-block">
C:\BuildFolder\leptonica<span class="filesystem">1.68</span>\vs2008\leptonica_versionnumbers.vsprops
</pre>
</div></blockquote>
<p>This lets you use the provided <tt class="docutils literal"><span class="pre">*_VERSION</span></tt> user macros when specifying
the libraries you want to link with.</p>
<p>For example, to link with the <span class="filesystem">liblept</span> DLL you should now set
<em class="guilabel">Configuration Properties | Linker | Input | Additional
Dependencies</em> to:</p>
<div class="highlight-none"><div class="highlight"><pre>liblept$(LIBLEPT_VERSION).lib
</pre></div>
</div>
<p>And to link with the static Release version of <span class="filesystem">liblept</span> use these:</p>
<div class="highlight-none"><div class="highlight"><pre>giflib$(GIFLIB_VERSION)-static-mtdll.lib
libjpeg$(LIBJPEG_VERSION)-static-mtdll.lib
libpng$(LIBPNG_VERSION)-static-mtdll.lib
libtiff$(LIBTIFF_VERSION)-static-mtdll.lib
zlib$(ZLIB_VERSION)-static-mtdll.lib
liblept$(LIBLEPT_VERSION)-static-mtdll.lib
</pre></div>
</div>
<p>You can view the user macros defined in <span class="filesystem">leptonica_versionnumbers.vsprops</span> by opening the <em class="menuselection"><span class="accelerator">V</span>iew ‣ Oth<span class="accelerator">e</span>r Windows ‣ Property <span class="accelerator">M</span>anager</em> and looking at the <em class="guilabel">Common Properties | User Macros</em> page.</p>
<p>If you copy this file to a known location, reference it in your own
Projects, and use the new <tt class="docutils literal"><span class="pre">*_VERSION</span></tt> macros when specifying linker
dependencies, you will be isolated from worrying about version number
changes in library filenames. After that, you can use the Property
Manager (or a text editor since it&#8217;s a simple XML file) to fix any
version number updates by changing this one file.</p>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
<div style="text-align: center; padding-right: 5px;">
 <a href="http://www.leptonica.com" >
  <img src="_static/moller52-smaller.jpg" border="0" alt="Leptonica Home"/>
 </a>
</div>



<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="overview.html">Overview</a></li>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html">Quickstart</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="">Downloading <span class="filesystem">liblept</span> pre-built binaries and header files for Windows</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#about-version-numbers-in-library-filenames">About version numbers in library filenames</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="building-other-programs.html">Building programs that link with <span class="filesystem">liblept</span></a></li>
<li class="toctree-l1"><a class="reference internal" href="directory-organization.html">Directory organization</a></li>
<li class="toctree-l1"><a class="reference internal" href="vs2008-solution.html">The <span class="filesystem">liblept</span> Visual Studio 2008 Solution</a></li>
<li class="toctree-l1"><a class="reference internal" href="building-prog-dir.html">Building the <span class="filesystem">prog</span> directory programs</a></li>
<li class="toctree-l1"><a class="reference internal" href="installing-cygwin.html">Installing Cygwin coreutils</a></li>
<li class="toctree-l1"><a class="reference internal" href="installing-irfanview.html">Installing IrfanView to view images</a></li>
<li class="toctree-l1"><a class="reference internal" href="installing-gnuplot.html">Installing gnuplot to view plots</a></li>
<li class="toctree-l1"><a class="reference internal" href="csharp-and-liblept.html">c# and <span class="filesystem">liblept</span></a></li>
<li class="toctree-l1"><a class="reference internal" href="building-image-libraries.html">(Optional) Building <span class="filesystem">zlib</span>, <span class="filesystem">libjpeg</span>, <span class="filesystem">libpng</span>, <span class="filesystem">libtiff</span> and <span class="filesystem">giflib</span></a></li>
<li class="toctree-l1"><a class="reference internal" href="building-liblept.html">(Optional) Building the <span class="filesystem">liblept</span> library</a></li>
<li class="toctree-l1"><a class="reference internal" href="vs2010-notes.html">Visual Studio 2010 Notes</a></li>
<li class="toctree-l1"><a class="reference internal" href="package-contents.html">Package Contents</a></li>
<li class="toctree-l1"><a class="reference internal" href="versions.html">Version Notes</a></li>
</ul>


<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" size="18" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="building-other-programs.html" title="Building programs that link with liblept"
             >next</a></li>
        <li class="right" >
          <a href="quickstart.html" title="Quickstart"
             >previous</a> |</li>
  <li><a href="http://www.leptonica.com">Leptonica Home</a> &raquo;</li>
  
        <li><a href="index.html">VS2008 Notes (for v1.68)</a> &raquo;</li>
 
      </ul>
    </div>
  <div class="footer">

   <span class="creativecommons">
    <a href="http://creativecommons.org/licenses/by/3.0/us/" >
      <img src="_static/creativecommons-88x31.png"
	   border="0" alt="Creative Commons License"/>
     </a>
    Leptonica by 
    <a href="http://leptonica.com/www.leptonica.org">
    Dan Bloomberg
    </a>
    is licensed under a
    <a href="http://creativecommons.org/licenses/by/3.0/us/">
     Creative Commons Attribution 3.0 United States License.
    </a>
   </span>

   
   <span class="sphinxcreditr">
   Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
   </span>
   

    <script type="text/javascript">
      _uacct = "UA-144810-1";
      urchinTracker();
    </script>
  </div>
  </body>
</html>